package com.zj.HJ;

import java.util.Scanner;

public class HJ15 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        String s1 = Integer.toBinaryString(num);
        String s2 = s1.replace("1", "");
        System.out.println(s1.length() - s2.length());
    }

    public static String getRes(String num) {

        return new StringBuilder(num).reverse().toString();
    }


}
